<template>
  <a href="javascript:void(0)" @click="onClick">点击</a>
</template>
<script setup lang="ts">
import { ref } from "vue";
// js 语法
// let param = ref("");
// const emit = defineEmits(["on-notice"]);
// ts 语法
let param = ref<string>("");
// 定义
const emit = defineEmits<{
  (event: "on-notice", data: string, ext: boolean): void;
  (event: "on-message"): void;
}>();

const onClick = () => {
  param.value = "abc_" + new Date().getTime();
  // 触发事件
  emit("on-notice", param.value, true);
};
</script>
